Enviado por: YoUnGLiNk
Fecha: 1075542023
Actualizado: 1075542023
¿Usa base de datos?: 1
Visitas: 744
Votos: 0
Descargado: 17 veces
Valoración: 0.00
» Valora este script «
ZipDescargar

Bueno esto es una pequeña chapucilla que he hecho pero funciona bien asi que la pondre aquí ;) En el archivo ZIP os adjunto las imagenes del bloque que tienen que estar en una carpeta que se llame bloque :)


o <?
if($_COOKIE["unick"] ) {
?>
<table width="100%" border="0" cellspacing="9" cellpadding="0">
<tr>
<td><font size="1" face="verdana" color="#FFFFFF">
<form action="modules.php?name=Your_Account" method="post">
<img src="bloque/group-4.gif" height="14" width="17"><b><u>Bienvenido,<br></u></b>
o<b><center><? echo $_COOKIE["unick"] ?></center></b>
<b></b>
</form>
</font>
</table>
<? include("config.php") ;
$resp = mysql_query("select id,avatar from usuarios where nick='$_COOKIE[unick]'") ;
$datos = mysql_fetch_array($resp) ;
if(mysql_num_rows($resp) != 0) {
echo "<div align=\"center\"><img src=\"eforo_imagenes/avatares/$datos[id].$datos[avatar]\" width=\"50\" height=\"50\" border=\"0\"></div><br>" ;
}
?>
<hr>
<br>
<a href="index.php?id=uperfil">&middot; Mi perfil</a><a href="index.php?id=usuarios"><br>
</a><a href="index.php?id=mensajes" >&middot; Mensajes</a>
<?
include("config.php") ;
$usuario = $HTTP_COOKIE_VARS[unick] ;
$resp = mysql_query("select id from mensajes where nuevo='0' and destinatario='$usuario'") ;
$mensajes = mysql_num_rows($resp) ;
mysql_free_result($resp) ;
mysql_close($conectar) ;
if($mensajes == 0) {
?>
<?
}
else {
?>
<script>
function BlinkTxt() {
texto = document.getElementsByTagName('blink');
for (i=0; i<texto.length; i++)
if (texto[i].style.visibility=='hidden') {
texto[i].style.visibility='visible';
} else {
texto[i].style.visibility='hidden';
}
setTimeout('BlinkTxt()',100);
}
onload=BlinkTxt;
</script>
<blink><a href="index.php?id=usalir">&middot; Salir</a><br>
<?
}
?>
<a href="index.php?id=usuarios"><br>
</a><a href="index.php?id=usalir">&middot; Salir</a><a href="?usuarios"></a><a href="?usuarios"><br>
</a>
<hr>
<img src="bloque/group-2.gif" height="14" width="17"> <b><u>Registrados:</u></b><br>
<img src="bloque/ur-moderator.gif" height="14" width="17"> Ultimo: <b>
<?
include("config.php") ;

$resp = mysql_query("select * from usuarios order by id desc limit 1") ;

while($datos = mysql_fetch_array($resp)) {
echo "
$datos[nick]<br>
" ;
}
mysql_free_result($resp) ;
mysql_close($conectar) ;
?>

o

</b>
o
o<?
include("config.php") ;
$fecha = time() ;
// Tiempo en el cuál se considerará al usuario en línea en minutos
$tiempo = 1 ;
// Se le resta el tiempo en minutos a la fecha actual
$tiempo = $fecha-$tiempo*60 ;
$ip = $REMOTE_ADDR ;
$usuario = $_COOKIE["unick"] ;
// Se eliminan las fechas que sean menores al tiempo límite
mysql_query("delete from uenlineavis where fecha< $tiempo") ;
mysql_query("delete from uenlineareg where fecha< $tiempo") ;
// Para los usuarios no registrados
$resp = mysql_query("select ip from uenlineavis where ip='$ip'") ;
if(mysql_num_rows($resp) == 0) {
mysql_query("insert into uenlineavis values ('$ip','$fecha')") ;
}
else {
mysql_query("update uenlineavis set fecha='$fecha' where ip='$ip'") ;
}
mysql_free_result($resp) ;
// Para los usuarios registrados
if($_COOKIE["unick"] ) {
$resp = mysql_query("select usuario from uenlineareg where usuario='$usuario'") ;
if(mysql_num_rows($resp) == 0) {
mysql_query("insert into uenlineareg values ('$usuario','$fecha')") ;
}
else {
mysql_query("update uenlineareg set fecha='$fecha' where usuario='$usuario'") ;
}
mysql_free_result($resp) ;
}
// Se obtiene el número de usuarios en línea
$resp = mysql_query("select ip from uenlineavis") ;
// Número de usuarios
$usuarios = mysql_num_rows($resp) ;
mysql_free_result($resp) ;
$resp = mysql_query("select usuario from uenlineareg") ;
// Número de registrados
$registrados = mysql_num_rows($resp) ;
mysql_free_result($resp) ;
// Número de anonimos
$anonimos = $usuarios - $registrados ;
// Se obtiene el nick de los usuarios que se encuentran en línea
$resp = mysql_query("select usuario from uenlineareg") ;
if(mysql_num_rows($resp) != 0) {
$renlinea = "" ;
while($datos = mysql_fetch_array($resp)) {
$resp3 = mysql_query("select * from usuarios where nick='$datos[usuario]'") ;
$datos3 = mysql_fetch_array($resp3) ;
$renlinea .= " <<a href=index.php?id=usuarios&u=$datos3[id] ></a><a href=index.php?id=mensajes&responder=$datos[usuario]>$datos[usuario]</a>> " ;
}
}
?>

<?
mysql_free_result($resp) ;
mysql_close($conectar) ;
?>

<img src="bloque/ur-guest.gif" height="14" width="17"> Totales:<b>
<?
include("config.php") ;
$resp = mysql_query("select * from usuarios order by id desc limit 1") ;
while($datos = mysql_fetch_array($resp)) {
echo "
$datos[id]<br>
" ;
}
mysql_free_result($resp) ;
mysql_close($conectar) ;
?>
</b><hr>
<img src="bloque/group-3.gif" height="14" width="17"> <b><u>Usuarios en l&iacute;nea:</u></b> <br>
<img src="bloque/ur-anony.gif" height="14" width="17"> Anonimos: <b><? echo "$anonimos" ?></b><br>
<img src="bloque/ur-member.gif" height="14" width="17"> Registrados: <b><? echo "$registrados" ?></b><br>
<img src="bloque/ur-registered.gif" height="14" width="17"> Total: <b><? echo "$usuarios" ?></b><br>
<hr>
<br>
<?
}
else {
?>
Bienvenido, Anonimo<form method="post" action="uentrar.php">
Nick:<br>
<input name="nick" type="text" class="form" size="18">
<br>
Contraseña:<br>
<input name="contrasena" type="password" class="form" size="18">
o
<br>
<br>
<input type="submit" name="entrar" value="Entrar" class="form">
o <input type="hidden" name="pagina" value="<? echo $_SERVER['REQUEST_URI'] ?>">
</form>

<a href="index.php?id=uregistrar">· Registrate</a><br>
<a href="index.php?id=ucontrasena">· Olvid&eacute; la contraseña</a><br>
<br> ¿No estas registrado? Puedes <a href="index.php?id=uregistrar">crearte
una cuenta aquí</a>. Como usuario registrado tendrás ventajas como cambiar tu
perfil, responder comentarios con tu propio nick<br>
o<hr>
<img src="bloque/group-2.gif" height="14" width="17"> <b><u>Registrados:</u></b><br>
<img src="bloque/ur-moderator.gif" height="14" width="17"> Ultimo: <b>
<?
include("config.php") ;

$resp = mysql_query("select * from usuarios order by id desc limit 1") ;

while($datos = mysql_fetch_array($resp)) {
echo "
$datos[nick]<br>
" ;
}
mysql_free_result($resp) ;
mysql_close($conectar) ;
?>

</b> <img src="bloque/ur-guest.gif" height="14" width="17"> Totales:<b>
<?
include("config.php") ;
$resp = mysql_query("select * from usuarios order by id desc limit 1") ;
while($datos = mysql_fetch_array($resp)) {
echo "
$datos[id]<br>
" ;
}
mysql_free_result($resp) ;
mysql_close($conectar) ;
?>
</b> <?
include("config.php") ;
$fecha = time() ;
// Tiempo en el cuál se considerará al usuario en línea en minutos
$tiempo = 1 ;
// Se le resta el tiempo en minutos a la fecha actual
$tiempo = $fecha-$tiempo*60 ;
$ip = $REMOTE_ADDR ;
$usuario = $_COOKIE["unick"] ;
// Se eliminan las fechas que sean menores al tiempo límite
mysql_query("delete from uenlineavis where fecha< $tiempo") ;
mysql_query("delete from uenlineareg where fecha< $tiempo") ;
// Para los usuarios no registrados
$resp = mysql_query("select ip from uenlineavis where ip='$ip'") ;
if(mysql_num_rows($resp) == 0) {
mysql_query("insert into uenlineavis values ('$ip','$fecha')") ;
}
else {
mysql_query("update uenlineavis set fecha='$fecha' where ip='$ip'") ;
}
mysql_free_result($resp) ;
// Para los usuarios registrados
if($_COOKIE["unick"] ) {
$resp = mysql_query("select usuario from uenlineareg where usuario='$usuario'") ;
if(mysql_num_rows($resp) == 0) {
mysql_query("insert into uenlineareg values ('$usuario','$fecha')") ;
}
else {
mysql_query("update uenlineareg set fecha='$fecha' where usuario='$usuario'") ;
}
mysql_free_result($resp) ;
}
// Se obtiene el número de usuarios en línea
$resp = mysql_query("select ip from uenlineavis") ;
// Número de usuarios
$usuarios = mysql_num_rows($resp) ;
mysql_free_result($resp) ;
$resp = mysql_query("select usuario from uenlineareg") ;
// Número de registrados
$registrados = mysql_num_rows($resp) ;
mysql_free_result($resp) ;
// Número de anonimos
$anonimos = $usuarios - $registrados ;
// Se obtiene el nick de los usuarios que se encuentran en línea
$resp = mysql_query("select usuario from uenlineareg") ;
if(mysql_num_rows($resp) != 0) {
$renlinea = "" ;
while($datos = mysql_fetch_array($resp)) {
$resp3 = mysql_query("select * from usuarios where nick='$datos[usuario]'") ;
$datos3 = mysql_fetch_array($resp3) ;
$renlinea .= " <<a href=index.php?id=usuarios&u=$datos3[id] ></a><a href=index.php?id=mensajes&responder=$datos[usuario]>$datos[usuario]</a>> " ;
}
}
?>

<?
mysql_free_result($resp) ;
mysql_close($conectar) ;
?>
<hr>
<img src="bloque/group-3.gif" height="14" width="17"> <b><u>Usuarios en l&iacute;nea:</u></b> <br>
<img src="bloque/ur-anony.gif" height="14" width="17"> Anonimos: <b><? echo "$anonimos" ?></b><br>
<img src="bloque/ur-member.gif" height="14" width="17"> Registrados: <b><? echo "$registrados" ?></b><br>
<img src="bloque/ur-registered.gif" height="14" width="17"> Total: <b><? echo "$usuarios" ?></b><br>
<hr>
<?
}
?>


PD en el codigo como vereis sobran muchas cosas si alguien se anima a editarlo que lo postee en mods :P